﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Timetable.Base.Entities;
using Timetable.Base.Interfaces.Repositories;
using Ninject;
using Timetable.Base.Interfaces.Validators;

namespace Timetable.Data.Services.DataServices
{
    public class LecturerService: BaseDataService<Lecturer>
    {
        IRepository<Lecturer> _repository;
        IValidator<Lecturer> _validator;

        [Inject]
        public LecturerService(IRepository<Lecturer> repository, IValidator<Lecturer> validator)
        {
            _repository = repository;
            _validator = validator;
        }

        public override Base.Interfaces.Repositories.IRepository<Lecturer> Repository
        {
            get { return _repository; }
        }

        public override Base.Interfaces.Validators.IValidator<Lecturer> Validator
        {
            get { return _validator; }
        }

        public override IQueryable<Lecturer> All()
        {
            return Repository.Get();
        }

        public override Lecturer GetById(int id)
        {
            return Repository.GetById(id);
        }
    }
}
